<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>帮助中心 - 家庭药品管理</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="css/common.css">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#16a34a',
                        secondary: '#4ade80',
                        dark: '#1e293b',
                        light: '#f8fafc'
                    }
                }
            }
        }
    </script>
    <style>
        /* iPhone 15 模拟外壳样式 */
        .iphone-frame {
            width: 390px;
            height: 844px;
            border-radius: 44px;
            background-color: #000;
            margin: 20px auto;
            position: relative;
            overflow: hidden;
            box-shadow: 0 0 0 10px #111, 0 0 0 11px #333, 0 20px 50px rgba(0, 0, 0, 0.3);
        }
        
        /* 顶部刘海区域 */
        .iphone-notch {
            position: absolute;
            top: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 200px;
            height: 30px;
            background-color: #000;
            border-radius: 0 0 20px 20px;
            z-index: 10;
        }
        
        /* 底部安全区域 */
        .iphone-home-indicator {
            position: absolute;
            bottom: 8px;
            left: 50%;
            transform: translateX(-50%);
            width: 120px;
            height: 5px;
            background-color: rgba(255, 255, 255, 0.6);
            border-radius: 5px;
            z-index: 10;
        }
        
        /* 顶部状态栏 */
        .iphone-status-bar {
            height: 50px;
            background-color: #fff;
            padding-top: 15px;
            padding-left: 20px;
            padding-right: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 14px;
            font-weight: 600;
        }
        
        /* 内容区域 */
        .iphone-content {
            height: calc(100% - 50px - 83px);
            background-color: #f8fafc;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            padding: 20px;
        }
        
        /* 底部导航栏 */
        .iphone-nav {
            height: 83px;
            background-color: white;
            border-top: 1px solid #e5e7eb;
            display: flex;
            justify-content: space-around;
            align-items: center;
            position: absolute;
            bottom: 0;
            width: 100%;
        }
        
        /* 导航项样式 */
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: #9ca3af;
            text-decoration: none;
            font-size: 12px;
        }
        
        .nav-item.active {
            color: #16a34a;
        }
        
        .nav-item i {
            font-size: 22px;
            margin-bottom: 5px;
        }
        
        /* 页面头部样式 */
        .page-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        
        .page-header h1 {
            font-size: 18px;
            font-weight: 600;
            color: #1e293b;
        }
        
        /* 帮助中心样式 */
        .help-section {
            background-color: white;
            border-radius: 12px;
            margin-bottom: 16px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            overflow: hidden;
        }
        
        .section-title {
            padding: 16px 20px;
            background-color: #f8fafc;
            font-weight: 600;
            color: #1e293b;
            border-bottom: 1px solid #e5e7eb;
        }
        
        .help-item {
            padding: 16px 20px;
            border-bottom: 1px solid #f1f5f9;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .help-item:last-child {
            border-bottom: none;
        }
        
        .help-item-title {
            font-weight: 500;
            color: #1e293b;
        }
        
        .help-item-icon {
            color: #64748b;
            font-size: 14px;
        }
        
        /* 联系我们样式 */
        .contact-section {
            background-color: white;
            border-radius: 12px;
            padding: 20px;
            margin-top: 16px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            text-align: center;
        }
        
        .contact-title {
            font-weight: 600;
            color: #1e293b;
            margin-bottom: 12px;
        }
        
        .contact-description {
            color: #64748b;
            font-size: 14px;
            margin-bottom: 16px;
        }
        
        .contact-button {
            background-color: #16a34a;
            color: white;
            padding: 12px 24px;
            border-radius: 24px;
            font-weight: 600;
            text-decoration: none;
            display: inline-block;
            transition: all 0.3s ease;
        }
        
        .contact-button:active {
            transform: scale(0.98);
        }
        
        /* 常见问题样式 */
        .faq-item {
            border-bottom: 1px solid #f1f5f9;
        }
        
        .faq-question {
            padding: 16px 20px;
            font-weight: 500;
            color: #1e293b;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .faq-answer {
            padding: 0 20px 16px 20px;
            display: none;
            color: #64748b;
            font-size: 14px;
            line-height: 1.5;
        }
        
        .faq-item.active .faq-answer {
            display: block;
        }
        
        .faq-item.active .fa-chevron-right {
            transform: rotate(90deg);
        }
    </style>
</head>
<body>
    <div class="iphone-frame">
        <!-- 顶部刘海 -->
        <div class="iphone-notch"></div>
        
        <!-- 状态栏 -->
        <div class="iphone-status-bar">
            <div>9:41</div>
            <div class="flex space-x-2">
                <i class="fa fa-signal"></i>
                <i class="fa fa-wifi"></i>
                <i class="fa fa-battery-full"></i>
            </div>
        </div>
        
        <!-- 内容区域 -->
        <div class="iphone-content">
            <!-- 顶部导航 -->
            <div class="page-header">
                <div class="flex items-center">
                    <button class="mr-4 w-8 h-8 flex items-center justify-center" id="backButton">
                        <i class="fa fa-arrow-left text-gray-600"></i>
                    </button>
                    <h1>帮助中心</h1>
                </div>
            </div>

            <!-- 搜索框 -->
            <div class="mb-4">
                <div class="relative">
                    <input type="text" placeholder="搜索帮助内容..." 
                        class="w-full py-3 px-4 pr-10 rounded-lg border border-gray-200 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary">
                    <i class="fa fa-search absolute right-4 top-1/2 -translate-y-1/2 text-gray-400"></i>
                </div>
            </div>

            <!-- 热门问题 -->
            <div class="help-section mb-6">
                <div class="section-title">热门问题</div>
                <div class="help-item" data-target="section1">
                    <span class="help-item-title">如何添加新药品？</span>
                    <i class="fa fa-chevron-right help-item-icon"></i>
                </div>
                <div class="help-item" data-target="section2">
                    <span class="help-item-title">如何设置用药提醒？</span>
                    <i class="fa fa-chevron-right help-item-icon"></i>
                </div>
                <div class="help-item" data-target="section3">
                    <span class="help-item-title">如何备份我的数据？</span>
                    <i class="fa fa-chevron-right help-item-icon"></i>
                </div>
                <div class="help-item" data-target="section4">
                    <span class="help-item-title">如何添加家庭成员？</span>
                    <i class="fa fa-chevron-right help-item-icon"></i>
                </div>
            </div>

            <!-- 常见问题 -->
            <div class="help-section mb-6">
                <div class="section-title">常见问题</div>
                <div class="faq-item">
                    <div class="faq-question">
                        <span>如何查看药品过期提醒？</span>
                        <i class="fa fa-chevron-right help-item-icon transition-transform"></i>
                    </div>
                    <div class="faq-answer">
                        在首页的提醒区域可以查看即将过期的药品。系统会自动检测药品的有效期，并在过期前30天、15天和7天发出提醒。您也可以在"药品管理"页面点击筛选按钮，选择"即将过期"来查看所有即将过期的药品。
                    </div>
                </div>
                <div class="faq-item">
                    <div class="faq-question">
                        <span>如何导出我的药品数据？</span>
                        <i class="fa fa-chevron-right help-item-icon transition-transform"></i>
                    </div>
                    <div class="faq-answer">
                        您可以在"我的"页面点击"备份与恢复"，然后在"数据导出"部分选择导出格式（Excel、CSV、PDF或图片），系统会生成相应格式的文件供您下载保存。
                    </div>
                </div>
                <div class="faq-item">
                    <div class="faq-question">
                        <span>如何修改已添加的药品信息？</span>
                        <i class="fa fa-chevron-right help-item-icon transition-transform"></i>
                    </div>
                    <div class="faq-answer">
                        在"药品管理"页面，点击您想要修改的药品卡片进入药品详情页，然后点击右上角的编辑按钮，修改完成后点击保存即可更新药品信息。
                    </div>
                </div>
                <div class="faq-item">
                    <div class="faq-question">
                        <span>如何删除不再需要的提醒？</span>
                        <i class="fa fa-chevron-right help-item-icon transition-transform"></i>
                    </div>
                    <div class="faq-answer">
                        在"提醒"页面，点击您想要删除的提醒，进入提醒详情页，然后点击右上角的删除按钮，确认后即可删除该提醒。
                    </div>
                </div>
                <div class="faq-item">
                    <div class="faq-question">
                        <span>如何修改我的个人信息？</span>
                        <i class="fa fa-chevron-right help-item-icon transition-transform"></i>
                    </div>
                    <div class="faq-answer">
                        在"我的"页面，点击"个人资料"进入个人信息编辑页面，您可以修改头像、昵称、联系方式等信息，修改完成后点击保存即可。
                    </div>
                </div>
            </div>

            <!-- 使用指南 -->
            <div class="help-section mb-6">
                <div class="section-title">使用指南</div>
                <div class="help-item" data-target="guide1">
                    <span class="help-item-title">药品管理功能指南</span>
                    <i class="fa fa-chevron-right help-item-icon"></i>
                </div>
                <div class="help-item" data-target="guide2">
                    <span class="help-item-title">提醒功能使用教程</span>
                    <i class="fa fa-chevron-right help-item-icon"></i>
                </div>
                <div class="help-item" data-target="guide3">
                    <span class="help-item-title">家庭成员管理指南</span>
                    <i class="fa fa-chevron-right help-item-icon"></i>
                </div>
            </div>

            <!-- 联系我们 -->
            <div class="contact-section">
                <div class="contact-title">需要更多帮助？</div>
                <div class="contact-description">如果您遇到了没有在帮助中心找到答案的问题，请联系我们的客服团队。</div>
                <a href="#" class="contact-button">联系客服</a>
            </div>
        </div>
        
        <!-- 底部导航栏 -->
        <div class="iphone-nav">
            <a href="index.html" class="nav-item">
                <i class="fa fa-home"></i>
                <span>首页</span>
            </a>
            <a href="medicine_management.html" class="nav-item">
                <i class="fa fa-medkit"></i>
                <span>药品</span>
            </a>
            <a href="add_medicine.html" class="nav-item">
                <i class="fa fa-plus"></i>
                <span>添加</span>
            </a>
            <a href="reminder.html" class="nav-item">
                <i class="fa fa-bell"></i>
                <span>提醒</span>
            </a>
            <a href="profile.html" class="nav-item active">
                <i class="fa fa-user"></i>
                <span>我的</span>
            </a>
        </div>
        
        <!-- 底部安全指示器 -->
        <div class="iphone-home-indicator"></div>
    </div>

    <script>
        // 返回按钮点击事件
        document.getElementById('backButton').addEventListener('click', function() {
            window.history.back();
        });

        // 热门问题点击事件
        const helpItems = document.querySelectorAll('.help-item');
        helpItems.forEach(item => {
            item.addEventListener('click', function() {
                const target = this.getAttribute('data-target');
                console.log('用户点击了帮助项:', target);
                // 在实际应用中，这里可以跳转到对应的详情页面
                alert(`正在加载 "${this.querySelector('.help-item-title').textContent}" 的详细说明...`);
            });
        });

        // FAQ 展开/收起功能
        const faqQuestions = document.querySelectorAll('.faq-question');
        faqQuestions.forEach(question => {
            question.addEventListener('click', function() {
                const faqItem = this.closest('.faq-item');
                faqItem.classList.toggle('active');
            });
        });

        // 联系客服按钮点击事件
        document.querySelector('.contact-button').addEventListener('click', function(e) {
            e.preventDefault();
            console.log('用户点击了联系客服');
            alert('正在连接客服，预计等待时间：1-3分钟');
        });

        // 搜索框功能
        document.querySelector('input[placeholder="搜索帮助内容..."]').addEventListener('keyup', function(e) {
            if (e.key === 'Enter') {
                const searchQuery = this.value.trim();
                if (searchQuery) {
                    console.log('用户搜索了:', searchQuery);
                    alert(`正在搜索 "${searchQuery}" 的相关帮助内容...`);
                }
            }
        });
    </script>
</body>
</html>